package com.yohann.algorithm;

/**
 * <p>
 * 递归
 * </p>
 *
 * @author Yohann
 * @since 2020/9/24
 */
public class RecursiveTest {
    public static void main(String[] args) {
        System.out.println(factorial(20));
    }

    public static long factorial(long n) {
        if (n > 1) {
            return n * factorial(n - 1);
        }else {
            return 1;
        }
    }
}